//
//  ViewController.swift
//  SwiftEx
//
//  Created by XuYa on 15/5/5.
//  Copyright (c) 2015年 XuYa. All rights reserved.
//

import UIKit
import Parse
import Bolts
import SwiftyJSON

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        /*var object = PFObject(className: "TestClass")
        object.addObject("ObjectValue", forKey: "ObjectKey")
        object.saveInBackgroundWithBlock { (Success: Bool, error:NSError? ) -> Void in
            println("saved in background")
        }*/
        
        
        //var jsObject: JSON = JSON.nullJSON
        var data = [Dictionary<String, String>]()
        data.append(["price":"1.20","city":"Foo","_id":"326105","street":"One"])
        data.append(["price":"1.20","city":"Bar","_id":"326104","street":"Two"])
        data.append(["price":"1.30","city":"Nee","_id":"326106","street":"Three"])
        //let jsonStr = "[ \"name\" : testname, \"jobtitle\" : consultant, \"location\": Singapore ]"
        //println(jsonStr)
        var json:JSON = JSON(data)
        println(json)
        let name:String = json[0]["city"].stringValue
        println(name)
        //println(json["jobtitle"].stringValue)
        println("Completed")
        
        //ssh commit
        println("commit by ssh")
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}

